package com.poi.java.dao;

import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface TableDao {

//    @Select("select COLUMN_NAME from information_schema.COLUMNS where TABLE_SCHEMA = (select database()) and TABLE_NAME=#{tableName}")
//    List<String> listTableColumn(String tableName);

//    @Insert("insert into industry_priceindex(id,year,quarter,price_index) values(111,2024,3,10)")
//    void inse();

    @Select("SELECT * FROM land_appraiser where id=#{id}")
    Map<String,Object> appraiser(Integer id);

    @Select("SELECT number FROM appraiser where id=#{id}")
    String appraiserNumber(String id);

    @Select("SELECT * FROM base_land_price where id=#{id}")
    Map<String,Object> base_land_price(Long id);

    @Select("SELECT * FROM coblp where id=#{id}")
    Map<String,Object> coblp(int id);





    @Select("SELECT DISTINCTROW usetype,price_define  FROM coblp where region_name = #{usetype}")
    List<Map<String,Object>> coblpbyRegin(String region_name);

    @Select("SELECT * FROM coblp where price_define=#{price_define} AND region_name = #{region_name} AND usetype = #{usetype} order by level ASC")
    List<Map<String,Object>> plot_ratio(String price_define,String region_name,String usetype);

    @Select("SELECT filename_ach  FROM guidance_document where region_name='${region_name}'")
    String guidance_document(@Param("region_name") String region_name);

    @Select("SELECT price_index FROM industry_priceindex where year=#{year} and quarter =#{quarter}")
    String industry_priceindex(int year,int quarter);

//    @Select("SELECT * FROM industry_priceindex where id=#{id}")
//    Map<String,Object> industry_priceindex(Long id);

    @Select("SELECT * FROM land_case where id=#{id}")
    Map<String,Object> land_case(int id);


    @Select("SELECT * FROM land_material where id=#{id}")
    Map<String,Object> land_material(int id);

    @Select("SELECT * FROM land_project where mid=#{id} order by value_date desc")
    List<Map<String,Object>> land_project(int id);

    @Select("SELECT * FROM land_temp where id=#{id}")
    Map<String,Object> land_temp(Long id);

    @Select("SELECT * FROM rr_price where region_name=#{region_name} and expirationdate=#{valueDate}")
    Map<String,Object> rr_price(String region_name, String valueDate);

    @Select("SELECT * FROM cbbj_database where region_name=#{region_name} AND region_level=#{region_level} AND expirationdate=#{valueDate} order by expirationdate desc")
    List<Map<String,Object>> cbbj_database(String region_name, String region_level, String valueDate);


    @Select("SELECT * FROM wz_ccoblp where use_levela=#{use_levela}")
    List<Map<String,Object>> wz_ccoblp(int use_levela);

    @Select("SELECT * FROM xc_ccoblp where use_levela=#{use_levela}")
    List<Map<String,Object>> xc_ccoblp(int use_levela);

    @Select("SELECT * FROM gs_ccoblp where use_levela=#{use_levela}")
    List<Map<String,Object>> gs_ccoblp(int use_levela);

    @Update("update land_project set p_path=#{p_path} where projectid=#{projectid}")
    void setpPath(Integer projectid,String p_path);

    @Select("select * from coblp where region_name=#{region} and usetype=#{usages} and level=#{use_level1}")
    Map<String,Object> getCoblp(String region, String usages, String use_level1);
}
